<html>
<script>
function dragElement(srcElement, deltaX, deltaY) {
    var x = srcElement.offsetLeft;
    var y = srcElement.offsetTop;
    eventSender.mouseMoveTo(x, y);
    eventSender.mouseDown();
    eventSender.leapForward(100);
    eventSender.mouseMoveTo(x + deltaX, y + deltaY);
    eventSender.mouseUp();
}

window.ondragend = function() { window.parent.finishUp(); };

function test() {
  // Stash the parent so we can use it after |window| is gone.
  var w = window.parent;
  // This does a drag and drop, which will delete this frame when the
  // drag ends, via the ondragend handler above.
  dragElement(document.getElementById('anchor'), 50, 50);
  // End the test through the parent.
  w.testRunner.notifyDone();
}
</script>
<body>
<a href="#" id="anchor">Test Link</a>
</body>
</html>
